/*===========================================================================
Article:       Promoting Democracy under Electoral Authoritarianism: Evidence from Cambodia
Authors:       Susan D. Hyde, Emily Lamb, Oren Samet
Dependencies:  UC Berkeley
Journal:	   Comparative Political Studies
---------------------------------------------------------------------------
Last Replicated In: Stata version 16.1 
Last Replication Date: October 15, 2022      
===========================================================================*/

clear
**Set working directory here
capture cd "/Users/orensamet/Dropbox/Cambodia (shared with Oren)/Submission to CPS/CPS Replication files"

****************************************************************
***				 		SURVEY ANALYSIS 					 ***
****************************************************************


*** Figure 1: Summary Treatment Effects by Survey Section ***

clear
use "Cambodiaworkingdata_preuse.dta"
drop if followupcomplete==0
save "Cambodiaworkingdata.dta", replace

cap erase tables/indices.xml
cap erase tables/indices.txt
macro drop dvs
local dvs KPPindex1 KPPindex2 FPindex_positiveonly EPP3index EPP4index_positiveonly EPP5index_positiveonly IMPindex CPP1index_agreeonly CPO2index_agreeonly 
tempfile results_1
tempfile results_all
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/indices.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear
drop if parm~="townhall"
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr if myqval>=.001 & p<.001

generate priority="H1. Knowledge Index (KPP1)" in 1
replace priority="H1. Knowledge Index (KPP2)" in 2
replace priority="H2. Familiarity with Politics Index (FP1-3)" in 3
replace priority="H3. Engagement in the Political Process Index (EPP3)" in 4
replace priority="H3. Engagement in the Political Process Index (EPP4)" in 5
replace priority="H3. Engagement in the Political Process Index (EPP5)" in 6
replace priority="H4. MNA Responsiveness Index (IMP 1 &3)" in 7
replace priority="H5. Confidence in the Political Process Index (CPP)" in 8
replace priority="H5. Confidence in the Political Options Index (CPO)" in 9
encode priority, gen(numpriority)
eclplot estimate min95 max95 numpriority, horiz ylabel(#9, labsize(small)) xline(0,lpattern(dot) lcolor(grey)) xtitle("Estimated Effect & 95% Confidence Interval") ytitle(" ") title("Survey Section Indices") xscale( range(-.3 .3)) xlabel(-.3(.1).3)
graph export "graphs/summaryindices.pdf", as(pdf)   replace


*** Baseline means for all variables in tables ***

clear
use "Cambodiaworkingdata.dta"

su b_KPP1_response b_KPP2_response b_KPP3_response b_MNAcorrect b_KPP4_response b_KPP5_dummy_exclusive b_KPPindex1 b_KPP6_1 b_KPP6_2 b_KPP6_3 b_KPP6_4 b_KPP6_5 b_KPP6_6 b_KPPindex2 b_FP1_new b_FP2_new b_FP3_new b_FPindex_positiveonly b_EPP1 b_EPP2 b_EPP3_1 b_EPP3_2 b_EPP3_3 b_EPP3_4 b_EPP3_5 b_EPP3_6 b_EPP3_7 b_EPP3_8 b_EPP3_9 b_EPP3_10 b_EPP3index b_EPP4_1_ordinal b_EPP4_2_ordinal b_EPP4_3_ordinal b_EPP4_4_ordinal b_EPP4_5_ordinal b_EPP4_6_ordinal b_EPP4_7_ordinal b_EPP4_8_ordinal b_EPP4_9_ordinal b_EPP4_10_ordinal b_EPP4_11_ordinal b_EPP4_12_ordinal b_EPP4index_positiveonly b_EPP5_1_ordinal b_EPP5_2_ordinal b_EPP5_3_ordinal b_EPP5_4_ordinal b_EPP5_5_ordinal b_EPP5_6_ordinal b_EPP5_7_ordinal b_EPP5_8_ordinal b_EPP5index_positiveonly b_IMP1 b_IMP3_response b_IMPindex b_CP1_1_new b_CP1_2_new b_CP1_3_new b_CP1_4_new b_CPP1index_agreeonly b_CP2_1_new b_CP2_2_new b_CP2_3_new b_CP2_4_new b_CP2_5_new b_CP2_6_new b_CPO2index_agreeonly 


*** Table 1: Knowledge of the Political Process ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE1.xml
cap erase tables/TABLE1.txt
macro drop dvs
local dvs KPP1_response KPP2_response KPP3_response MNAcorrect KPP4_response KPP5_dummy_exclusive KPPindex1 KPP6_1 KPP6_2 KPP6_3 KPP6_4 KPP6_5 KPP6_6 KPPindex2
tempfile results_1
tempfile results_all
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE1.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `results_all', replace
	restore
	}

use `"`results_all'"', clear

drop if parm~="townhall"

generate question="1. KPP1: What does the National Assembly do?" in 1
replace question="2. KPP2: What does a MNA do?" in 2
replace question="3. KPP3: Can you name one or more MNAs from your province?" in 3
replace question="4. If yes (KPP3), is the answer correct?" in 4
replace question="5. KPP4: What are three things you believe your MNAs are supposed to do for you and your community?" in 5
replace question="6. KPP5: Do you have the right to talk to your MNAs about your concerns?" in 6
replace question="KPPindex_1" in 7
replace question="7a. KPP6_1" in 8
replace question="7b. KPP6_2" in 9
replace question="7c. KPP6_3" in 10
replace question="7d. KPP6_4" in 11
replace question="7e. KPP6_5" in 12
replace question="7f. KPP6_6" in 13
replace question="KPPindex_2" in 14

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


*** Table 2: Familiiarity with Politics ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE2.xml
cap erase tables/TABLE2.txt
macro drop dvs
local dvs FP1_new FP2_new FP3_new FPindex_positiveonly
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE2.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear
	
drop if parm~="townhall"

generate question="FP1" in 1
replace question="FP2" in 2
replace question="FP3" in 3
replace question="FPindex" in 4

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


*** Table 3: Engagement in the Political Process ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE3.xml
cap erase tables/TABLE3.txt
macro drop dvs
local dvs EPP1 EPP2 EPP3_1 EPP3_2 EPP3_3 EPP3_4 EPP3_5 EPP3_6 EPP3_7 EPP3_8 EPP3_9 EPP3_10 EPP3index 
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE3.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear

drop if parm~="townhall"

generate question="1. EPP1" in 1
replace question="2. EPP2" in 2
replace question="3a .Religious Associations" in 3
replace question="3b.Cultural Associations" in 4
replace question="3c.NGOs" in 5
replace question="3d.Development Associations" in 6
replace question="3e.Farmers Association" in 7
replace question ="3f.Fisher's Association" in 8
replace question="3g.Forest Community Assoc." in 9
replace question="3h.Political Party" in 10
replace question="3i.Self-help Group" in 11
replace question="3j.Others" in 12
replace question="EPP3_index" in 13

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


*** Table 4: Engagement in the Political Process ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE4.xml
cap erase tables/TABLE4.txt
macro drop dvs
local dvs EPP4_1_ordinal EPP4_2_ordinal EPP4_3_ordinal EPP4_4_ordinal EPP4_5_ordinal EPP4_6_ordinal EPP4_7_ordinal EPP4_8_ordinal EPP4_9_ordinal EPP4_10_ordinal EPP4_11_ordinal EPP4_12_ordinal EPP4index_positiveonly
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE4.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear

drop if parm~="townhall"

generate question="4a. EPP4_1" in 1
replace question="4b. EPP4_2" in 2
replace question="4c. EPP4_3" in 3
replace question="4d. EPP4_4" in 4
replace question="4e. EPP4_5" in 5
replace question="4f. EPP4_6" in 6
replace question="4g. EPP4_7" in 7
replace question="4h. EPP4_8" in 8
replace question="4i. EPP4_9" in 9
replace question="4j. EPP4_10" in 10
replace question="4k. EPP4_11" in 11
replace question="4l. EPP4_12" in 12
replace question="EPP4_index" in 13

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


*** Table 5: Engagement in the Political Process ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE5.xml
cap erase tables/TABLE5.txt
macro drop dvs
local dvs EPP5_1_ordinal EPP5_2_ordinal EPP5_3_ordinal EPP5_4_ordinal EPP5_5_ordinal EPP5_6_ordinal EPP5_7_ordinal EPP5_8_ordinal EPP5index_positiveonly
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE5.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear

drop if parm~="townhall"

generate question="5a. EPP5_1" in 1
replace question="5b. EPP5_2" in 2
replace question="5c. EPP5_3" in 3
replace question="5d. EPP5_4" in 4
replace question="5e. EPP5_5" in 5
replace question="5f. EPP5_6" in 6
replace question="5g. EPP5_7" in 7
replace question="5h. EPP5_8" in 8
replace question="EPP5_index" in 9

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


*** Table 6: MNA Responsiveness ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE6.xml
cap erase tables/TABLE6.txt
macro drop dvs
local dvs IMP1 IMP3_response IMPindex
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE6.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}

use `"`results_all'"', clear

drop if parm~="townhall"

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr if myqval>=.001 & p<.001

**** Table 7: Confidence in the Political Process and Options

clear
use "Cambodiaworkingdata.dta"
cap erase tables/TABLE7.xml
cap erase tables/TABLE7.txt
macro drop dvs
local dvs CP1_1_new CP1_2_new CP1_3_new CP1_4_new CPP1index_agreeonly CP2_1_new CP2_2_new CP2_3_new CP2_4_new CP2_5_new CP2_6_new CPO2index_agreeonly
tempfile results_1
tempfile results_all
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/TABLE7.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}	

use `"`results_all'"', clear

drop if parm~="townhall"
	
use `"`results_all'"', clear
drop if parm~="townhall"
generate question="CP1_1" in 1
replace question="CP1_2" in 2
replace question="CP1_3" in 3
replace question="CP1_4" in 4
replace question="CP1_index" in 5
replace question="CP2_1" in 6
replace question="CP2_2" in 7
replace question="CP2_3" in 8
replace question="CP2_4" in 9
replace question="CP2_5" in 10
replace question="CP2_6" in 11
replace question="CP2_index" in 12

* FDR test using Benjamini-Hochburg. Add notes to tables for any listed parameters.
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval estimate stderr question if myqval>=.05 & p<.05
list label ylabel p myqval estimate stderr question if myqval>=.01 & p<.01
list label ylabel p myqval estimate stderr question if myqval>=.001 & p<.001


****************************************************************
***				 		ELECTION RESULTS 					 ***
****************************************************************

*** Figure 2: Change in Vote Share from 2008 to 2013 ***

use "2013 election results Cambodia.dta" , clear
preserve

tempfile dm1 dm2 dm3 
regress  allopp_totalvotes_13 allopp_votetotal_08 treatment  regvotersin2012  i.distnum, robust
outreg2 using tables/eresults2, e(rmse) bdec(2) tdec(2) replace
parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`dm1', replace)

regress  p4 CPP_votetotal_08 treatment  regvotersin2012  i.distnum, robust
outreg2 using tables/eresults2, e(rmse) bdec(2) tdec(2)  excel
parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`dm2', replace)

regress  totalvotescast totalvotescast08 treatment regvotersin2012  i.distnum, robust
outreg2 using tables/eresults2, e(rmse) bdec(2) tdec(2)  
parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`dm3', replace)


reshape wide communesangkat - turnout08, i(distnum) j(treatment)

scatter  OPP_gain_08to131 OPP_gain_08to130 distnum , yline(0) lstyle(dash) ytitle("Change in Vote Share from 08" "(2013 % of Vote - 2008 % of Vote)") xtitle("Village Pairs") msymbol(O Sh) legend(label(1 "Opposition Gain Treatment") label (2 "Opposition Gain Control ") cols(1)) yscale( range(-.2 .2)) ylabel(-.2 (.1) .2) xlabel(1 (1) 9)
graph save "graphs/votesharechangeopposition.gph", replace

scatter  CPP_gain_08to131 CPP_gain_08to130 distnum , yline(0) lstyle(dash) ytitle("Change in Vote Share from 08" "(2013 % of Vote - 2008 % of Vote)") xtitle("Village Pairs") msymbol(O Sh) legend(label(1 "CPP Gain Treatment") label (2 "CPP Gain Control") cols(1)) yscale( range(-.2 .2)) ylabel(-.2 (.1) .2) xlabel(1 (1) 9)
graph save "graphs/votesharechangeCPP.gph", replace

graph combine graphs/votesharechangeopposition.gph graphs/votesharechangeCPP.gph, cols(1) ysize(6)
graph save "graphs/votesharechange.gph", replace
graph export "graphs/votesharechange.pdf", as(pdf) replace


signrank CPP_gain_08to131= CPP_gain_08to130
signrank OPP_gain_08to131= OPP_gain_08to130
signrank absOPPgain_08to131=absOPPgain_08to130
signrank absCPPgain_08to131=absCPPgain_08to130


****************************************************************
***				 			APPENDIX 						 ***
****************************************************************

*** Appendix Figure 2: Summary of Baseline Balance Tests for Demographic and Summary Indices ***

clear
use "Cambodiaworkingdata.dta"

cap erase tables/baseline.xml
cap erase tables/baseline.txt
local controls  i.district
local dvs b_DEMO1 b_DEMO4dummy1 b_DEMO5 b_DEMO6  b_hhownindex b_DEMO11_dum1 b_DEMO12 b_DEMO13 b_INTRO1_exclusive b_INTRO2_exclusive b_KPPindex1 b_KPPindex2 b_FPindex_positiveonly b_EPP3index b_EPP4index_positiveonly b_EPP5index_positiveonly b_IMPindex b_CPP1index_agreeonly b_CPO2index_agreeonly 
tempfile balance_1
tempfile balance_all
preserve
drop _all
save `balance_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress `var' townhall `controls', robust cluster(commune)
	outreg2 using "tables/balance.xls", label e(rmse) bdec(3) tdec(3) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`balance_1', replace)
	preserve
	use `balance_all', clear
	append using `balance_1'
	save `"`balance_all'"', replace
	restore
	}

use `"`balance_all'"', clear
drop if parm~="townhall"

gen demo="a.Gender (male=1)" in 1
replace demo="b. Married" in 2
replace demo="c. Years Schooling" in 3
replace demo="d. Reading Level" in 4
replace demo="f. Assets Index" in 5
replace demo="l. Ethnicity" in 6
replace demo="l. Dwelling Type" in 7
replace demo="m. Electricity" in 8
replace demo="n. Prior Town Hall?" in 9
replace demo="o. Town Hall on Radio?" in 10
replace demo="p. b_KPPindex1" in 11
replace demo="q.  b_KPPindex2" in 12
replace demo="r. b_FPindex_positiveonly" in 13
replace demo="s. b_EPP3index" in 14
replace demo="t. b_EPP4index_positiveonly" in 15
replace demo="u. b_EPP5index_positiveonly" in 16
replace demo="v. b_IMPindex" in 17
replace demo="w. b_CPP1index_agreeonly" in 18
replace demo="x. b_CPO2index_agreeonly" in 19


encode demo, gen(numdemo)
eclplot estimate min95 max95 numdemo, horiz ylabel(#19, labsize(small)) xline(0,lpattern(dot) lcolor(grey)) xtitle("Estimated Difference & 95% Confidence Interval") ytitle(" ") xscale( range(-.5 .5)) xlabel(-.5(.1).5)
graph save "graphs/baseline.gph", replace
graph export "graphs/baseline.pdf", as(pdf) replace


*** Appendix Figure 3: Change in Citizens’ Top Three Priority Issues ***

clear
use "Cambodiaworkingdata.dta"
cap erase tables/priorityissues.xml
cap erase tables/priorityissues.txt
macro drop dvs
local dvs PI_landseizure_dummy PI_lacktransparency_dummy PI_agriculture_dummy PI_lackinf_dummy PI_debt_dummy  PI_commodityprice_dummy PI_discrimination_dummy PI_border_dummy  PI_representation_dummy PI_logging_dummy PI_education_dummy PI_poverty_dummy PI_gangs_dummy
tempfile results_1
tempfile results_all 
preserve
drop _all
save `results_all', emptyok
restore 

foreach var in `dvs' {
	quietly regress f_`var' townhall b_`var' i.district, robust cluster(commune)
	outreg2 using "tables/priorityissues.xls", label e(rmse) bdec(2) tdec(2) `append' excel
	local append "append"
	estimates store d_`var'
	parmest, label ylabel stars(0.05 0.01 0.001) format(estimate min* max* p N*)saving(`results_1', replace)
	preserve
	use `results_all', clear
	append using `results_1'
	save `"`results_all'"', replace
	restore
	}
use `"`results_all'"', clear
drop if parm~="townhall"
qqvalue p , method(simes) qvalue(myqval) 
list label ylabel p myqval if myqval>.05
generate priority="Land Seizure" in 1
replace priority="Lack of Transparency" in 2
replace priority="Agriculture" in 3
replace priority="Lack of Infrastructure" in 4
replace priority="Debt" in 5
replace priority="High Price of Commodities" in 6
replace priority="Discrimination" in 7
replace priority="Border Issues" in 8
replace priority="Representation" in 9
replace priority="Logging" in 10
replace priority="Education" in 11
replace priority="Poverty" in 12
replace priority="Gangs" in 13
encode priority, gen(numpriority)
eclplot estimate min95 max95 numpriority, horiz ylabel(#13, labsize(small)) xline(0,lpattern(dot) lcolor(grey)) xtitle("Estimated Effect & 95% Confidence Interval") ytitle(" ") title("Citizens' Top Three Priority Issues") xscale( range(-.5 .5)) xlabel(-.5(.1).5)
graph export "graphs/townhallPI.pdf", as(pdf)   replace


*** Appendix Table 1: Evaluation of Survey Attrition *** 

use "Cambodiaworkingdata_preuse.dta", replace
**Table 1: Survey attrition 
regress followupcomplete townhall i.district, robust cluster(commune)


*** Appendix Tables 2-8 replicable via R code ***
